<?php

class Control_PhotoAction extends Control_Action{
        public function setArgs($args = null) {
        if (null != $args) {
            $this->args = $args;
        }
        return $this;
    }

    public function setView($view) {
        if (null != $view) {
            $this->view = $view;
        }
        return $this;
    }

    public function run() {
        $t = Model_File::getSTime();
        $photoMapper = new Model_FileMapper();
        $res = $photoMapper->howManyPages($this->args['user']);

           $this->view->paginator = Model_Paginator::howManyPages($res[0], 10);
           $this->view->user = $this->args['user'];
           $this->view->photo = $photoMapper->getTenImg($this->args['user'], $this->args['page']);

        $this->view->setInnerTemplate('photo');
        $_SESSION['time'] = Model_File::getTime($t);
        $_SESSION['memory'] = memory_get_usage();
    }
}